monitor_reconfig: Add script to run for external displays. This adds a run_monitor_configure script that uses xrandr to check if there's an external display connected, and then runs monitor_reconfigure if so. I plan to make us run this after starting the X server. Change-Id: Ia19b5832950e405d9d88295226771d6364846b99 BUG=chromium-os:1743 TEST=ran it Review URL: http://codereview.chromium.org/3647002 
diff --git a/run_monitor_reconfigure b/run_monitor_reconfigure new file mode 100755 index 0000000..33a4438 --- /dev/null +++ b/run_monitor_reconfigure 
@@ -0,0 +1,20 @@ +#!/bin/sh + +# Copyright (c) 2010 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# If there's an external display connected, runs the monitor_reconfigure +# command to choose a screen resolution. + +XRANDR=/usr/bin/xrandr +MONITOR_RECONFIGURE=/usr/bin/monitor_reconfigure + +# Always exit with 0 +trap "exit 0" EXIT +set -e + +NUM_OUTPUTS=$($XRANDR | grep -c ' connected') +if [ "$NUM_OUTPUTS" -gt 1 ]; then + $MONITOR_RECONFIGURE +fi